package com.zby.admin.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zby.admin.pojo.Admin;
import com.zby.admin.pojo.dto.AdminDto;
import com.zby.admin.pojo.dto.UserDto;
import com.zby.admin.pojo.LoginResult;
import com.zby.admin.pojo.vo.UserVo;
import com.zby.utils.Result;
import jakarta.servlet.http.HttpServletRequest;

public interface UserService extends IService<Admin> {

    LoginResult login(AdminDto admin, HttpServletRequest request);

    Page<Admin> selectPage(Integer page, Integer pageSize);

    boolean insertSave(AdminDto adminDto, HttpServletRequest request);

    boolean updateAdminInfo(AdminDto adminDto, HttpServletRequest request);

    boolean insertData(UserDto userVo);


    Page<UserVo> selectUserPage(Integer page, Integer pageSize);
    
    /**
     * 获取个人用户信息
     * @param request HTTP请求对象，用于获取用户会话信息
     * @return UserVo 用户信息视图对象
     */
    UserVo getUserInfo(HttpServletRequest request);
    
    /**
     * 更新用户信息
     * @param userDto 用户信息传输对象
     * @param request HTTP请求对象，用于获取用户会话信息
     * @return boolean 更新是否成功
     */
    boolean updateUserInfo(UserDto userDto, HttpServletRequest request);
    
    /**
     * 根据用户ID获取用户信息
     * @param id 用户ID
     * @return Result<UserVo> 用户信息结果封装
     */
    Result<UserVo> getUserInfoById(Integer id);

    Result<Integer> removeUserById(Integer id);
}